package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.util.StringUtil;
import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.util.SexEnum;
import com.frogs.system.util.UserFamilyStatusEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

/**
 * 同步家庭成员信息请求类
 *
 * @author hongyuhao
 * @version 2014年5月29日 - 上午10:37:23
 */
public class UserFamilyMemberSyncRequest extends Request {
	
	private static final long serialVersionUID = -5856413403871702861L;

	private Integer userId;
	
	private String openId;
	
	/** */
	public UserFamilyMemberSyncRequest() {
	}

	@Override
	public void parse(HttpServletRequest request) {
		
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		
		
		this.userId = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), -1);
		if( userId < 1) {
			throw new RequestIllegalException("error userId:"+userId);
		}
		
		this.openId = requestInfo.getParameter(ApiUrlParamEnum.openId.getParamName());
		if( StringUtil.isEmpty(openId) ) {
			throw new RequestIllegalException("error openId:"+openId);
		}
	}
	
	public int getUserId() {
		return userId;
	}
	
	public void setUserId(int userId) {
		this.userId = userId;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}
}
